import axios from "axios"
import {prefix,postheaders} from "./index";
//查询库存商品集合
export const listItems = async (params) => {
    let response = await axios({
        method: "get",
        url: prefix +"/items/stock" ,
        params
    })
    console.log(response)
    return response.data;
}
//按照库存id查询库存信息
export const findStockId = async (stockId) => {
    let response = await axios({
        method: "get",
        url: prefix +"/items/stock/"+stockId ,
    })
    return response.data;
}

//添加商品信息
export const addItems = async (stockId,itemPrice) => {
    let response = await axios({
        method: "get",
        postheaders,
        url: prefix + "/items/add",
        params: {
            stockId,
            itemPrice
        },
    });
    return  response;
}
//添加图片
export const addPictur = async (imgBase64) => {
    let response = await axios({
        method: "post",
        postheaders,
        url: prefix + "/items/addPicture",
        imgBase64
    });
    return response;
};